<?
/*
+--------------------------------------------------------------------------
|   TalkBack Ticket System
|   ========================================
|   by Oliver Hayman
|   (c) 2007 OlliesPage.net
|   ========================================
|   
|   
+---------------------------------------------------------------------------
|   > $Date: 2007-09-02 16:56:14 +0000 (Sun, 02 Sep 2007) $
|   > $Author: Oliver Hayman $
+---------------------------------------------------------------------------
|
|   > TalkBack
|   > TalkBack Session starting Module
|   > Date started: Friday 03rd August 2007 (20:48)
|
+--------------------------------------------------------------------------
*/
session_start(); if(!isset($_SESSION['username'])) { header("location: login.php"); }
include('main.php');
if(isset($_POST['name'])) {
$name = $_SESSION['firstname'].' '.$_SESSION['lastname'];
if($_POST['responce'] == 'no') { $reply = 0; } else { $reply = 1 ;} $anon = 0;
$addr = 'NULL,'; $postcode = 'NULL,'; 
if($_POST['tell'] != '') { $tel = '\''.$_POST[tell].'\','; } else { $tel = 'NULL,'; }
if($_POST['email'] != '') { $email = '\''.$_POST[email].'\','; } else { $email = 'NULL,'; }
$optional = 'NULL, NULL, NULL, NULL,';
$sql = 'INSERT INTO `messages` (`Uid`, `Message`, `status`, `Name`, `Uname`, `Anon`, `Tel`, `E-Mail`, `Respond`, `time`, `Uip`, `type`) VALUES (NULL, \''.htmlspecialchars($_POST[message]).'\', \'1\', \''.$name.'\', \''.$_SESSION[username].'\', \''.$anon.'\', \''.$tel.'\' \''.$email.'\' \''.$reply.'\', CURRENT_TIMESTAMP, \''.$_SERVER[REMOTE_ADDR].'\', \'1\');';

echo '<center><img src="images/header.jpg"></center>';
mysql_query($sql) or die('Adding Talkback Failed!<br />'. mysql_error());

// ------------------
// Make the page here
// ------------------
echo '<meta http-equiv="refresh" content="0;url=index.php">';
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style>
.row2
{
	BACKGROUND-COLOR: #F7FAFF;
	COLOR: #000000;
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}
.smalltext
{
    FONT-SIZE: 11px;
    COLOR: #333333;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}

a.footer:link {		color: #333333; }
a.footer:visited {	color: #333333; }
a.footer:hover {	color: #333333; text-decoration: underline; }
a.footer:active {	color: #333333; }
a.footer {			text-decoration: none; }
.text
{
    FONT-SIZE: 13px;
    COLOR: #333333;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}
</style>
<link REL="shortcut icon" HREF="favicon.ico" TYPE="image/x-icon">
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
  <style type="text/css">
<!--
#Layer1 {
	position:absolute;
	width:768px;
	height:20px;
	z-index:1;
	left: 20%;
	top: 126px;
}
-->
  </style>
</head>
<body>
<center><img src="images/header.jpg"></center>
<!-- style="background-image: url('images/formbg.gif');
background-repeat: no-repeat;" -->
<table align="center" width="489" height="524" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="70"><div style="position: relative; left:38%;"><h2>New TalkBack Session</h2></div></td>
  </tr>
  <tr>
    <td align="center" valign="top"><form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post">
      <table class="smalltext" border="0" cellpadding="0" cellspacing="0" style="text-align: left; width: 95%;">
    <tbody>
      <tr>
        <td>&nbsp;Name</td>
        <td><input name="name" type="text" value="<? echo $_SESSION['firstname'].' '.$_SESSION['lastname']; ?>" readonly></td>
      </tr>
	  <tr>
        <td>&nbsp;Response Required</td>
        <td>Yes <input name="responce" checked="checked" value="yes"
 type="radio"> No <input name="responce" value="no" type="radio"></td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;Message:<br /><textarea rows="10" cols="30" style="width: 98%;" name="message"></textarea>
		&nbsp;<b>Optional Feilds:</b></td>
      </tr>
      <tr>
        <td>&nbsp;E-Mail Address</td>
        <td><input name="email" type="text"></td>
      </tr>
      <tr>
        <td>&nbsp;Telephone Number</td>
        <td><input name="tell" type="text"></td>
      </tr>
      <tr>
        <td colspan="2" rowspan="1" align="center"><input
 value="Post TalkBack" type="submit"></td>
      </tr>
    </tbody>
  </table></form></td>
  </tr>
</table>
<div id="Layer1">Please note: it is an OlliesPage Policy not to investigate support requests that contain offensive language. </div>
<br>
<? footer(); ?>
</body>
</html>
